package com.itheima.stock.web;

import com.itheima.stock.pojo.domain.InnerMarketDomain;
import com.itheima.stock.pojo.entity.SysUser;
import com.itheima.stock.service.StockService;
import com.itheima.stock.service.UserService;

import com.itheima.stock.vo.req.LoginReqVo;
import com.itheima.stock.vo.resp.LoginRespVo;
import com.itheima.stock.vo.resp.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author : itheima
 * @date : 2022/9/19 16:18
 * @description : 定义访问用户的服务接口
 */
@RestController
@RequestMapping("/api")
@CrossOrigin
@Api(value = "股票大盘相关接口定义",tags = "股票大盘-相关功能")
public class StockController {
   @Autowired
   private StockService stockService;

   /* 请求路径：/api/quot/index/all
    请求方式：GET
    参数：无*

    {
    "code": 1,
    "data": [
        {
            "code": "sh000001",//大盘编码
            "name": "上证指数",//指数名称
            "openPoint": 3267.81,//开盘点
            "curPoint": 3236.70,//当前点
            "preClosePoint": 3283.43,//前收盘点
            "tradeAmt": 160591,//交易量
            "tradeVol": 1741099,//交易金额
            "upDown": -46.73,//涨跌值
            "rose": -0.01.42,//涨幅
            "amplitude": 0.0164,//振幅
            "curTime": "2022-01-02 01:32"//当前时间
        },
      	{......}
    ]
}/
    */
    @ApiOperation(value = "当前时间大盘数据查询",notes = "当前时间大盘数据查询",response = R.class)
    @GetMapping("/quot/index/curtime")
    public R<List<InnerMarketDomain>> getCurtimeListInnerMarket(){
        return stockService.getListInnerMarket();
    }
    @ApiOperation(value = "当前时间大盘数据查询",notes = "当前时间大盘数据查询",response = R.class)
    @GetMapping("/quot/index/all")
    public R<List<InnerMarketDomain>> getAllListInnerMarket(){
        return stockService.getAllListInnerMarket();
    }





}
